/*
 * Clef.java
 *
 * Created on 22 november 2005, 20:25
 *
 * @author wijnand.schepens@hogent.be
 */

package org.jfonia.staffnotation;

import org.jfonia.connect5.basics.BasicValueNode;
import org.jfonia.connect5.basics.MutableValueNode;


public class BasicClef
{
        //Glyph types
        public enum Type { G, F, C, Gminus8, Gplus8, Fminus8, Fplus8 };
        
        //public final static BasicClef trebleClef = new BasicClef(Type.G, 6, 10);
        //public final static BasicClef bassClef   = new BasicClef(Type.F, 2, -2);
        //public final static BasicClef altoClef   = new BasicClef(Type.C, 4, 4);
        //public final static BasicClef tenorClef  = new BasicClef(Type.C, 2, 2);

        public final static BasicClef trebleClef = new BasicClef(Type.G, 2, -2);
        public final static BasicClef bassClef   = new BasicClef(Type.F, 6, 10);
        public final static BasicClef altoClef   = new BasicClef(Type.C, 4, 4);
        public final static BasicClef tenorClef  = new BasicClef(Type.C, 6, 6);
    
        private MutableValueNode<Type> typeNode;
        private MutableValueNode<Integer> staffRankNode;
        private MutableValueNode<Integer> centralCRankNode;
        
        /**
         * Construct new Clef
         * @param type G, F or C
         * @param staffRank y-position on staff, counting op from the bottom staff line, per 'tone'
         * @param centralCRank staffRank of central C 
         */
        public BasicClef(Type type, int staffRank, int centralCRank)
        {
                this.typeNode = new BasicValueNode<Type>(type);
                this.staffRankNode = new BasicValueNode<Integer>(staffRank);
                this.centralCRankNode = new BasicValueNode<Integer>(centralCRank);
        }

        //Integer denoting the type of glyphs (treble, bass, ut)
        public Type getType()
        {
                return typeNode.getValue();
        }

        //Y-staff-coordinate for glyph (e.g. standard treble is at 6, standard bass at 2)
        public int getStaffRank()
        {
                return staffRankNode.getValue();
        }

        public int getCentralCRank()
        {
                return centralCRankNode.getValue();
        }

        public MutableValueNode<Integer> getCentralCRankNode()
        {
                return centralCRankNode;
        }

        public MutableValueNode<Integer> getStaffRankNode()
        {
                return staffRankNode;
        }

        public MutableValueNode<Type> getTypeNode()
        {
                return typeNode;
        }

//    public double getPreX()
//    {
//    	return 0.0;
//    }
//    public double getPostX()
//    {
//    	return glyph.getBounds().getWidth(); // + spaceAfter;
//    }
//    
//    public double getPreY()
//    {
//    	return -staffRank - glyph.getBounds().getMinY(); 
//    }
//    public double getPostY()
//    {
//    	return staffRank + glyph.getBounds().getMaxY(); // 8.0;
//    }
    
//	protected TextGlyph     glyph;
} 
